import request from "../utils/request";
import Global from "@/store";
import { SpaceUser, SpaceUserParams } from "@/types/user";
import { removeCookie } from "@/utils/cookie";

/**
 * [登录](swagger文档地址)
 */
export async function login(params: SpaceUserParams.login) {
  return request<SpaceUser.UserInfo>("POST", "/xxx/xxx/login", params);
}

/**
 * [退出登录](swagger文档地址)
 */
export async function logOut() {
  Global.user.resetInfo();
  removeCookie(Global.config.tokenKey);
  return request("GET", "/xxx/xxx/login");
}
